package com.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.web.entity.PubNews;
import com.web.service.PubNewsService;

@Controller
@RequestMapping("pubnews")
public class PubNewController {

	@Autowired
	private PubNewsService pubNewsService;

	@RequestMapping("ckeditor")
	public String ckeditor() {
		System.out.println("显示ckeditor界面");
		return "pubEditor/ckeditor";
	}

	@RequestMapping("testCK")
	public String testCk() {

		return "pubEditor/testCK";
	}

	@ResponseBody
	@RequestMapping("save")
	public Map<String, Object> save(PubNews pubNews) {
		Map<String, Object> map = new HashMap<String, Object>();
		map = pubNewsService.addPubNews(pubNews);
		return map;
	}

}
